import fetch from '@/utils/fetch'
export const getInquiry = (data) => {
    return fetch.get('/v1/inquiry', {
        params: {
            patientid: localStorage.getItem('patient_id'),
            ...data
        }
    })
}

// 医生端获取当前所有患者会诊列表
export const getDInquiry = (data) => {
    return fetch.get('/v1/inquiry', {
        params: {
            ...data
        }
    })
}

// 医生端获取当前患者信息
export const putDInquiry = (id, data) => {
    return fetch.put(`/v1/inquiry/${id}`, {
        ...data
    })
}

// 与医生的聊天前，判断当前患者聊天状态
export const inquiryStatus = (data) => {
    return fetch.post('/v1/inquiry', { ...data })
}

// 患者端获取聊天室信息
export const inquiryMsg = (id) => {
    return fetch.get('/v1/inquiry', {
        params: {
            _id: id
        }
    })
}

// 结束问诊，修改当前问诊状态
export const finishInquiry = (id, data) => {
    return fetch.put(`/v1/inquiry/${id}`, { ...data })
}

// 提交医生评价
export const submitEva = (id, data) => {
    return fetch.put(`/v1/inquiry/${id}`, { rate: data })
}
